/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.reporting;

import TimeRecording.tables.AllocationOfHours;
import java.util.Date;

/**
 *
 * @author david
 */
public class TimesheetDay {

    private Date date;
    private AllocationOfHours base;

    private double fixedShortfall;
    private double semiFlexiOutstanding;
    private double flexiCredit;
    private double flexiWeeklyCredit;

    public TimesheetDay(AllocationOfHours base) {
        this.base = base;
    }

    public TimesheetDay() {
        this.base = new AllocationOfHours();
    }

    // Local getters and setters

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public double getFixedShortfall() {
        return fixedShortfall;
    }

    public void setFixedShortfall(double fixedShortfall) {
        this.fixedShortfall = fixedShortfall;
    }

    public double getFlexiCredit() {
        return flexiCredit;
    }

    public void setFlexiCredit(double flexiCredit) {
        this.flexiCredit = flexiCredit;
    }

    public double getFlexiWeeklyCredit() {
        return flexiWeeklyCredit;
    }

    public void setFlexiWeeklyCredit(double flexiWeeklyCredit) {
        this.flexiWeeklyCredit = flexiWeeklyCredit;
    }

    public double getSemiFlexiOutstanding() {
        return semiFlexiOutstanding;
    }

    public void setSemiFlexiOutstanding(double semiFlexiOutstanding) {
        this.semiFlexiOutstanding = semiFlexiOutstanding;
    }

    public AllocationOfHours getBase() {
        return base;
    }

    public void setBase(AllocationOfHours base) {
        this.base = base;
    }

    public boolean getEstimated() {
        return (base.getEntered() == 0 &&
                base.getClocked() == 0 &&
                base.getEstimated() > 0);
    }

    //////////////////////
    // Headline figures //
    //////////////////////

    public String getReportClocked() {
        if (base.getEntered() != 0) {
            return ReportingUtilities.twoDecimalsNullZero(base.getEntered());
        } else if (base.getClocked() != 0) {
            return ReportingUtilities.twoDecimalsNullZero(base.getClocked());
        } else {
            return ReportingUtilities.twoDecimalsNullZero(base.getEstimated());
        }
    }

    public String getReportSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSickness());
    }

    public String getReportHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getHoliday());
    }

    ///////////
    // Fixed //
    ///////////

    public String getReportFixedExpected() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFixedExpected());
    }

    public String getReportFixedRecorded() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFixedRecorded());
    }

    public String getReportFixedSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFixedSickness());
    }

    public String getReportFixedHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFixedHoliday());
    }

    public String getReportFixedShortfall() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFixedShortfall());
    }

    ///////////////
    // SemiFlexi //
    ///////////////

    public String getReportSemiFlexiExpected() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSemiFlexiExpected());
    }

    public String getReportSemiFlexiRecorded() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSemiFlexiRecorded());
    }

    public String getReportSemiFlexiSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSemiFlexiSickness());
    }

    public String getReportSemiFlexiHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSemiFlexiHoliday());
    }

    public String getReportSemiFlexiOutstanding() {
        return ReportingUtilities.twoDecimalsNullZero(semiFlexiOutstanding);
    }

    ///////////
    // Flexi //
    ///////////

    public String getReportFlexiExpected() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFlexiExpected());
    }

    public String getReportFlexiRecorded() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFlexiRecorded());
    }

    public String getReportFlexiSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFlexiSickness());
    }

    public String getReportFlexiHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getFlexiHoliday());
    }

    public String getReportFlexiCredit() {
        return ReportingUtilities.twoDecimalsNullZero(flexiCredit);
    }

    public String getReportFlexiWeeklyCredit() {
        return ReportingUtilities.twoDecimalsNullZero(flexiWeeklyCredit);
    }

    ///////////////
    // Sessional //
    ///////////////

    public String getReportSessionalExpected() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSessionExpected());
    }

    public String getReportSessionalRecorded() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSessionRecorded());
    }

    public String getReportSessionalSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSessionSickness());
    }

    public String getReportSessionalHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getSessionHoliday());
    }

    ////////////
    // Ad Hoc //
    ////////////

    public String getReportAdHocRecorded() {
        return ReportingUtilities.twoDecimalsNullZero(base.getAdHocRecorded());
    }

    public String getReportAdHocSickness() {
        return ReportingUtilities.twoDecimalsNullZero(base.getAdHocSickness());
    }

    public String getReportAdHocHoliday() {
        return ReportingUtilities.twoDecimalsNullZero(base.getAdHocHoliday());
    }
}